package org.spring.springboot.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.spring.springboot.domain.City;
import org.springframework.stereotype.Component;

/**
 * 城市业务逻辑实现类
 * <p>
 * Created by bysocket on 07/02/2017.
 */
@Component
public class CityService {

    private static final Logger LOGGER = LoggerFactory.getLogger(CityService.class);

   
    /**
     * 获取城市逻辑：
     * 如果缓存存在，从缓存中获取城市信息
     * 如果缓存不存在，从 DB 中获取城市信息，然后插入缓存
     */
    public City findCityById(Long id) {
        
        // 从 DB 中获取城市信息
        City city = new City();
        city.setCityName("NANJING");
        city.setProvinceId(12L);
        city.setDescription("xxxxxxoooo");
        city.setId(1201L);
       return city;
    }

}
